package com.trackerapp.util;


import android.content.SharedPreferences;

public class TrackerPreferenceManager {
	private static SharedPreferences preferences;
	
	public static class PreferenceKeys {
		public static String USER_ID = "user_id";
		public static String DEVICE_ID = "device_id";
		public static String SESSION_ID = "session_id";
		public static String DELIVERY_ID = "delivery_id";
		public static String DELIVERY_STARTED = "delivery_started";
		public static String DELIVERY_CONTENT = "delievery_content";
		public static String BILL_NUMBER = "bill_number";
	}
	
	public static void initializePreferenceManager(SharedPreferences _preferences) {
		preferences = _preferences;
	}


	public static boolean getBoolean(String key, boolean defaultValue) {
		return preferences.getBoolean(key, defaultValue);
	}


	public static void setBoolean(String key, boolean value) {
		SharedPreferences.Editor editor = preferences.edit();
		editor.putBoolean(key, value);
		editor.commit();
	}

	public static String getString(String key,String defaultValue) {
		return preferences.getString(key,defaultValue);
	}

	public static void setString(String key, String value) {
		SharedPreferences.Editor editor = preferences.edit();
		editor.putString(key, value);
		editor.commit();
	}

}
